package com.mk.seckill.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mk.seckill.mapper.GoodsMapper;
import com.mk.seckill.pojo.Goods;
import com.mk.seckill.service.IGoodsService;
import com.mk.seckill.vo.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {
	/**
	 * @Author hhwu
	 * @Description //TODO 商品服务类的实现
	 * @Date 15:02 2022/6/7
	 **/
	@Autowired
	private GoodsMapper goodsMapper;

	@Override
	public List<GoodsVo> findGoodsVo() {
		/**
		 * @Author hhwu
		 * @Description //TODO 获取商品列表
		 * @Date 15:02 2022/6/7
		 * @Param []
		 * @return java.util.List<com.xxxx.seckill.vo.GoodsVo>
		 **/
		return goodsMapper.findGoodsVo();
	}

	@Override
	public GoodsVo findGoodsVoByGoodsId(Long goodsId) {
		/**
		 * @Author hhwu
		 * @Description //TODO 获取商品详情
		 * @Date 15:04 2022/6/7
		 * @Param [goodsId]
		 * @return com.xxxx.seckill.vo.GoodsVo
		 **/
		return goodsMapper.findGoodsVoByGoodsId(goodsId);
	}
}
